//
//  PPMaskView.m
//  pickpic
//
//  Created by 胡文广 on 2017/5/1.
//  Copyright © 2017年 MicroDream. All rights reserved.
//

#import "PPMaskView.h"
@interface PPMaskView()

@property (nonatomic,strong) UIImageView *imageV;

@end
@implementation PPMaskView
- (UIImageView *)imageV{

    if (!_imageV) {
        _imageV = [[UIImageView alloc] init];
        _imageV.contentMode = UIViewContentModeScaleAspectFill;
        _imageV.image = [UIImage imageNamed:@"SliceSize"];
    }
    return _imageV;
}
- (void)show{

    self.imageV.frame = self.rec;
    [self addSubview:self.imageV];
}
- (void)layoutSubviews{

    [super layoutSubviews];
    
}

- (instancetype)initWithFrame:(CGRect)frame{

    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = BLACK;
        self.alpha = 0.5;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remove:)];
        
        [self addGestureRecognizer:tap];
    }
    return self;
}
- (void)remove:(UITapGestureRecognizer *)tap{

    [self removeFromSuperview];
}
@end
